#!/usr/bin/env python
"""Torii assembler-simulator"""

import os
import os.path
import sys
import gtksourceview2
from distutils.core import setup

from tori import __version__ as VERSION
from tori import __license__ as LICENSE
from tori import __name__ as NAME
from tori import __author__ as AUTHOR
from tori import __author_email__ as AUTHOR_EMAIL
from tori import __url__ as URL
from tori import __description__ as DESCRIPTION

base = os.path.join('share', 'torii')
base_ui = os.path.join(base, 'ui')
base_ui_gfx = os.path.join(base_ui, 'gfx')
glade_f = os.path.join('ui', 'tori.glade')
logo_f = os.path.join('ui', 'gfx', 'tori_logo.png')
icon_f = os.path.join('ui', 'gfx', 'tori_logo.ico')
langbases = gtksourceview2.language_manager_get_default().get_search_path()

langbase = langbases[0]
for i in langbases:
    if sys.prefix in i:
        langbase = i
        break


setup(name="torii",
      version=VERSION,
      description=DESCRIPTION,
      author=AUTHOR,
      author_email=AUTHOR_EMAIL,
      url=URL,
      license=LICENSE,
      packages=["tori"],
      scripts=["toried", "torias", "torisim"],
      data_files=[(base_ui, [glade_f]),
                (base_ui_gfx, [logo_f, icon_f]),
                (langbase, ['txori.lang']),
                ('share/applications', ['torii.desktop']),
                ('share/pixmaps', [logo_f])]
      )
